import SwiftUI

struct MainTabView: View {
    @State private var selectedTab = 0
    
    var body: some View {
        TabView(selection: $selectedTab) {
            // 首页
            HomeView()
                .tabItem {
                    Label("首页", systemImage: "drop.fill")
                }
                .tag(0)
            
            // 统计
            StatisticsView()
                .tabItem {
                    Label("统计", systemImage: "chart.bar.fill")
                }
                .tag(1)
            
            // 设置
            SettingsView()
                .tabItem {
                    Label("设置", systemImage: "gear")
                }
                .tag(2)
            
            // 个人中心
            ProfileView()
                .tabItem {
                    Label("个人", systemImage: "person.fill")
                }
                .tag(3)
        }
        .onAppear {
            // 请求通知权限
            NotificationManager.shared.requestPermission { granted in
                print("通知权限: \(granted ? "已授予" : "已拒绝")")
            }
        }
    }
} 